﻿#region 程序集引用
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using System.Text;
#endregion


namespace Zhang.SQLServer
{
    public class IPAddress : IDAL.Common.IIPAddress
    {
        public string GetIpAddress(string num)
        {
           string sql  = "select * from iptable where startipnum <='" + num + "' and endipnum >='" + num + "'";
            SQLHelper DB = new SQLHelper();
            DataTable dt = DB.ExecuteDataTable(CommandType.Text, sql,null);
            if (dt.Rows.Count > 0)
            {
                return dt.Rows[0]["country"].ToString() + dt.Rows[0]["local"].ToString();
            }
            else
            {
                return "未知";
            }
        }
    }
}
